// 2.设置响应头的中间件
module.exports =async (ctx,next) => {
  const contentType = 'application/json; charset=utf-8'
  // 设置响应头
  ctx.set('Content-Type', contentType)
  // 设置跨域设置
  ctx.set("Access-Control-Allow-Origin","*");
  ctx.set("Access-Control-Allow-Methods","DELETE,PUT,POST,GET,OPTIONS");
  // 设置响应体
  await next()
}